import request from '@/router/axios';

// 类别分页
export const getMaterialCategoryList = (current, size, params) => {
  return request({
    url: '/api/mes-warehouse/rule-relation/part/category/page',
    method: 'get',
    params: {
      current,
      size,
      ...params
    }
  });
};

// 物料分页
export const getMaterialList = (current, size, params) => {
  return request({
    url: '/api/mes-warehouse/rule-relation/part/master/page',
    method: 'get',
    params: {
      current,
      size,
      ...params
    }
  });
};
// 获取规则详情
export const getRules = (params) => {
  return request({
    url: '/api/mes-warehouse/rule-relation/detail/by/part/id',
    method: 'get',
    params: {
      ...params
    }
  });
};
// 根据规则分类
export const getCategory = (params) => {
  return request({
    url: '/api/blade-system/dict/dictionary',
    method: 'get',
    params: {
      ...params
    }
  });
};
// 保存或者更新
export const saveOrUpdate = (data) => {
  return request({
    url: '/api/mes-warehouse/rule-relation/submit',
    method: 'post',
    data: data
  });
};
//批量
export const batchSave = (data) => {
  return request({
    url: '/api/mes-warehouse/rule-relation/batch/submit',
    method: 'post',
    data: data
  });
};
//根据规则类型 查出具体名称
export const getRulesName = (params) => {
  return request({
    url: '/api/mes-warehouse/rule-scheme/informations',
    method: 'get',
    params: {
      ...params
    }
  });
};

export const getList = (params) => {
  return request({
    url: '/api/mes-admin/part-master/page',
    method: 'get',
    params: {
      ...params
    }
  });
};

export const getLazyList = (params) => {
  return request({
    url: '/api/mes-admin/part-category/lazy-list-page',
    method: 'get',
    params: {
      ...params
    }
  });
};
